<!doctype html>
<html>
<head>
    <title>LayIM移动版测试</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../layuiadmin/layui/css/layui.css" media="all">

</head>
<script src="../layuiadmin/layui/layui.js"></script>
<script>
    layui.config({
        base: '../layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'layim'], function () {
        var $ = layui.$
            , layim = layui.layim;

        $.get("{{url('chat/list')}}", function (data) {
            if (data.msg === "用户未登录") {
                layer.msg('用户未登录', {
                    icon: 2,
                    time: 1500 //2秒关闭（如果不配置，默认是3秒）
                }, function () {
                    window.location.href = "{{route('manager_login')}}";
                });
                return false;
            }


            //基础配置
            layim.config({

                init:  {
                    "mine": {
                        "username": "纸飞机"
                        ,"id": "100000"
                        ,"status": "online"
                        ,"sign": "在深邃的编码世界，做一枚轻盈的纸飞机"
                        ,"avatar": "//res.layui.com/images/fly/avatar/00.jpg"
                    }
                    ,"friend": [{
                        "groupname": "知名人物"
                        ,"id": 0
                        ,"list": [{
                            "username": "贤心"
                            ,"id": "100001"
                            ,"avatar": "//tva1.sinaimg.cn/crop.0.0.118.118.180/5db11ff4gw1e77d3nqrv8j203b03cweg.jpg"
                            ,"sign": "这些都是测试数据，实际使用请严格按照该格式返回"
                            ,"status": "online"
                        },{
                            "username": "刘小涛"
                            ,"id": "100001222"
                            ,"sign": "如约而至，不负姊妹欢乐颂"
                            ,"avatar": "//tva4.sinaimg.cn/crop.0.1.1125.1125.180/475bb144jw8f9nwebnuhkj20v90vbwh9.jpg"
                        },{
                            "username": "谢小楠"
                            ,"id": "10034001"
                            ,"avatar": "//tva2.sinaimg.cn/crop.1.0.747.747.180/633f068fjw8f9h040n951j20ku0kr74t.jpg"
                            ,"sign": ""
                        },{
                            "username": "马小云"
                            ,"id": "168168"
                            ,"avatar": "//tva1.sinaimg.cn/crop.0.0.180.180.180/7fde8b93jw1e8qgp5bmzyj2050050aa8.jpg"
                            ,"sign": "让天下没有难写的代码"
                        },{
                            "username": "徐小峥"
                            ,"id": "666666"
                            ,"avatar": "//tva1.sinaimg.cn/crop.0.0.512.512.180/6a4acad5jw8eqi6yaholjj20e80e8t9f.jpg"
                            ,"sign": "代码在囧途，也要写到底"
                        }]
                    },{
                        "groupname": "网红声优"
                        ,"id": 1
                        ,"list": [{
                            "username": "罗小凤"
                            ,"id": "121286"
                            ,"avatar": "//tva4.sinaimg.cn/crop.0.0.640.640.180/4a02849cjw8fc8vn18vktj20hs0hs75v.jpg"
                            ,"sign": "在自己实力不济的时候，不要去相信什么媒体和记者。他们不是善良的人，有时候候他们的采访对当事人而言就是陷阱"
                        },{
                            "username": "Z_子晴"
                            ,"id": "108101"
                            ,"avatar": "//tva1.sinaimg.cn/crop.0.23.1242.1242.180/8693225ajw8fbimjimpjwj20yi0zs77l.jpg"
                            ,"sign": "微电商达人"
                        },{
                            "username": "大鱼_MsYuyu"
                            ,"id": "12123454"
                            ,"avatar": "//tva2.sinaimg.cn/crop.0.0.512.512.180/005LMAegjw8f2bp9qg4mrj30e80e8dg5.jpg"
                            ,"sign": "我瘋了！這也太準了吧  超級笑點低"
                        },{
                            "username": "醋醋cucu"
                            ,"id": "102101"
                            ,"avatar": "//tva2.sinaimg.cn/crop.0.0.640.640.180/648fbe5ejw8ethmg0u9egj20hs0ht0tn.jpg"
                            ,"sign": ""
                        },{
                            "username": "柏雪近在它香"
                            ,"id": "3435343"
                            ,"avatar": "//tva2.sinaimg.cn/crop.0.8.751.751.180/961a9be5jw8fczq7q98i7j20kv0lcwfn.jpg"
                            ,"sign": ""
                        }]
                    },{
                        "groupname": "女神艺人"
                        ,"id": 2
                        ,"list": [{
                            "username": "王小贤"
                            ,"id": "76543"
                            ,"avatar": "//tvax3.sinaimg.cn/crop.0.0.996.996.180/006Ftl1oly8g8ckqshrgjj30ro0rojst.jpg?KID=imgbed,tva&Expires=1576236580&ssig=6IEtTJL5so"
                            ,"sign": "我爱贤心"
                        },{
                            "username": "佟小娅"
                            ,"id": "4803920"
                            ,"avatar": "//tva3.sinaimg.cn/crop.0.0.750.750.180/5033b6dbjw8etqysyifpkj20ku0kuwfw.jpg"
                            ,"sign": "我也爱贤心吖吖啊"
                        }]
                    }]
                    ,"group": [{
                        "groupname": "前端群"
                        ,"id": "101"
                        ,"avatar": "//tva1.sinaimg.cn/crop.0.0.200.200.50/006q8Q6bjw8f20zsdem2mj305k05kdfw.jpg"
                    },{
                        "groupname": "Fly社区官方群"
                        ,"id": "102"
                        ,"avatar": "//tva2.sinaimg.cn/crop.0.0.199.199.180/005Zseqhjw1eplix1brxxj305k05kjrf.jpg"
                    }]
                }

                //获取群员接口（返回的数据格式见下文）
                , members: {
                    url: '' //接口地址（返回的数据格式见下文）
                    , type: 'get' //默认get，一般可不填
                    , data: {} //额外参数
                }

                //上传图片接口（返回的数据格式见下文），若不开启图片上传，剔除该项即可
                , uploadImage: {
                    url: '' //接口地址
                    , type: 'post' //默认post
                }

                //上传文件接口（返回的数据格式见下文），若不开启文件上传，剔除该项即可
                , uploadFile: {
                    url: '' //接口地址
                    , type: 'post' //默认post
                }
                //扩展工具栏，下文会做进一步介绍（如果无需扩展，剔除该项即可）
                , tool: [{
                    alias: 'code' //工具别名
                    , title: '代码' //工具名称
                    , icon: '&#xe64e;' //工具图标，参考图标文档
                }]

                , msgbox: layui.cache.dir + 'css/modules/layim/html/msgbox.html' //消息盒子页面地址，若不开启，剔除该项即可
                , find: layui.cache.dir + 'css/modules/layim/html/find.html' //发现页面地址，若不开启，剔除该项即可
                , chatLog: layui.cache.dir + 'css/modules/layim/html/chatlog.html' //聊天记录页面地址，若不开启，剔除该项即可
            });
        });
    })

</script>
</html>
      